package org.maxgroundstation.groundstation.view.map;

/**
 * A class representing a GPS location.
 * @author Scott Davis
 * 
 * Copyright (C) 2010  Scott Davis
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
public class GpsLocation {

    // Data members
    private double latitude;
    private double longitude;
    
    /**
     * Constructor
     * @param latitude the latitude.
     * @param longitude the longitude.
     */
    public GpsLocation(double latitude, double longitude) {
        this.latitude = latitude;
        this.longitude = longitude;
    }
    
    /**
     * Gets the latitude.
     * @return latitude.
     */
    public double getLatitude() {
        return latitude;
    }
    
    /**
     * Gets the longitude.
     * @return longitude.
     */
    public double getLongitude() {
        return longitude;
    }
    
    @Override
    public boolean equals(Object object) {
        boolean result = false;
        if (object instanceof GpsLocation) {
            GpsLocation loc = (GpsLocation) object;
            result = true;
            if (loc.getLatitude() != latitude) result = false;
            if (loc.getLongitude() != longitude) result = false;
        }
        return result;
    }
}